package com.bzoa.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bzoa.api.dto.UserListPageDTO;
import com.bzoa.api.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author lands
 * @Date 2023/3/6 10:32
 * @Description 操作用户类
 */
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from bz_user where  id= #{userId} limit 1")
    User getUser(String userId) ;
    @Select("select * from bz_user where  username= #{username} and password= #{password} limit 1")
    User getUserByUsernamePwd(String username, String password) ;
    @Select("select * from bz_user where  username= #{username} limit 1")
    User getUserByUsername(String username) ;
    @Select("select * from bz_user where  nickname like CONCAT('%', #{nickname}, '%') and mobile like CONCAT('%', #{mobile}, '%') limit #{start},#{pageSize}")
    List<UserListPageDTO> getUserListPage(int start, int pageSize, String mobile, String nickname);
}
